<!DOCTYPE html>
<html>
    <head>
        <script src="js/vue.js"></script>
        <style>
            .fade-enter , .fade-leave-to {
                opacity: 0;
            }

            .fade-enter-active , .fade-leave-active {
                transition: opacity 1.5s;
            }
        </style>
    </head>
    <body>
        <div id="app">
            <transition name="fade" mode="in-out">
                <button v-bind:key="isOff" @click="isOff = !isOff" > 
                    {{isOff?'Off':'On'}} 
                </button>
            </transition>
        </div>
        <script>
            var vm = new Vue({
                el:'#app',
                data:{
                    isOff : true
                }
            });
        </script>
    </body>
</html>